source(here::here("code/load.R"))

here("data/meta_analyses_raw/Lu2018/figure1_p208.csv") |>
    read_csv() |>
    mutate(meta_id = "Lu2018",
           subfield = "PA",
           question = "Impact of Government Funding on Nonprofit Advocacy Engagement",
           study_year = gsub(".*(\\d{4}).*", "\\1", study),
           study_year = as.numeric(study_year),
           estimate = as.numeric(gsub(" \\(.*", "", es_ci)),
           conf.low = as.numeric(gsub(".*\\((.*),.*", "\\1", es_ci)),
           conf.high = as.numeric(gsub(".*, (.*)\\)", "\\1", es_ci)),
           std.error = (conf.high - conf.low) / 3.92,
           overall_effect = "yes") |>
    select(meta_id,
           subfield,
           question,
           study_id = study,
           study_year = study_year,
           estimate,
           std.error,
           overall_effect) |>
    write_csv(here("data/meta_analyses_clean/Lu2018.csv"))
